package com.software.chemistry.service.Impl;

import com.software.chemistry.entity.StudentInfo;
import com.software.chemistry.repository.StudentRepository;
import com.software.chemistry.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class StudentServiceImpl implements StudentService {

    private static final String TAG = "StudentServiceImpl";
    @Autowired
    private StudentRepository studentRepository;

    @Override
    public StudentInfo findStudentInfoByUserId(String userId) {
        StudentInfo studentInfo = studentRepository.findStudentInfoByStudentId(userId);
        return studentInfo;
    }



    @Override
    public StudentInfo updateStudentInfo(StudentInfo studentInfo) {
        System.out.println("impl updateStudentInfo: studentInfo->" + studentInfo.toString());
        StudentInfo update = studentRepository.save(studentInfo);
        return update;
    }



}
